<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use App\Engine\BaseModel;
use Illuminate\Database\Eloquent\Model;

/**
 * Class Appointment
 *
 * @property int $id
 * @property int $uid
 * @property string|null $name
 * @property string|null $phone
 * @property int $time
 * @property int $state
 * @property int $created_at
 * @property int $updated_at
 *
 * @package App\Models
 */
class Appointment extends BaseModel
{
	protected $table = 'appointments';

	public $with=["user"];

	protected $casts = [
		'uid' => 'int',
		'time' => 'int',
		'state' => 'int',
		'created_at' => 'int',
		'updated_at' => 'int'
	];

	protected $fillable = [
		'uid',
		'name',
		'phone',
		'time',
		'state'
	];

    public $rule=[

    ];
    public $ruleMessage=[

    ];

    public function setNameAttribute($value)
    {
        $this->attributes["name"]=base64_encode($value);
    }

    public function getNameAttribute($value)
    {
        return base64_decode($value);
    }
}
